import React from 'react';
import DropDownMenu from 'material-ui/lib/DropDownMenu';
import MenuItem from 'material-ui/lib/menus/menu-item';

export default class DropDownMenuArea extends React.Component {

    constructor(props) {
        super(props);
        this.state = {value: 2};
    }

    handleChange(event, index, value) {
        this.setState({value: value});
    };

    render() {
        var menuItem = this.props.items.map(function (item, index) {
            return (
                <MenuItem value={item.value} primaryText={item.content} key={index}/>
            )
        });
        return (
            <DropDownMenu value={this.state.value} onChange={this.handleChange.bind(this)}>
                {menuItem}
            </DropDownMenu>
        );
    }
}